<?php

/**
 * Log an error
 * 
 * @param string $message
 * @param boolean $print
 * @param boolean $stop
 * @author Pablo
 * @since 1.0
 */
function blg_log($message, $print= FALSE, $stop= FALSE){
	$time= date("Y/m/d H:i:s");
	
	$separator= ' >> ';
	
	$info= caller_info();
	$where= ' { \''.$info->function.'()\' in \''.$info->relative.'\' ['.$info->line.'] }';
	
	error_log($time.$separator.$message.$where."\r\n", 3, blg_get_config('log_file'));
	
	if($print)
		echo '<div style="border: 1px solid #DF0000; background-color: #FFFFFF; padding: 5px; margin: 0 0 1px 0;"><span style="color: #DF0000; font-weight: bold;">'.$message.'</span></div>';
		
	if($stop)
		exit();
}